using System;

using Game.Networking.Server;

namespace Game.Networking {
	public sealed class C_LoadFinalizeConfirmedMessageHandler : BaseClientMessageHandler {
		public override ClientPacketID CommandId {
			get {
				return ClientPacketID.LoadFinalizeConfirmed;
			}
		}

		public override void ProcessMessage(ClientState client, byte[] rawCommand) {
			client.ConnectionTime = DateTime.Now;
			client.CurrentState = CState.Connected;
			ServerChatManager.Instance.BroadcastFromServer(ChatMessageType.Info, $"Player {client.UserName} is on {client.Team} team.");
			ServerScriptController.Instance.OnPlayerConnected(client);
		}
	}
}
